package simulacao.util;

import javafx.scene.image.Image;
import simulacao.Config;

import java.util.Random;

/**
 * @author Marcello Willians
 */

// Returns random Double number from 0 to max - 1
public function random(max: Double): Double {
    Random{}.nextDouble() * max;
}

// Returns random Integer number from 0 to max - 1
public function random(max: Integer): Integer {
    Random{}.nextInt(max);
}

// Returns sign of the value
public function sign(n: Number): Integer {
    if (n == 0) {
        return 0;
    }

    if (n > 0) {
        1;
    } else {
        -1;
    }
}

public function makeImage(name: String) {
    Image { url: "{Config.DIRETORIO}recursos/{name}.png" };
}
